package com.yeyks.hotel.dto;

import com.yeyks.hotel.dal.domain.RoomInfo;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.util.Objects;

@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
public class HotelInfoC2bHotelVipSearchRoomDto {

    @ApiModelProperty("销售价")
    private Integer salePrice;
    @ApiModelProperty("实付价")
    private Integer payPrice;
    @ApiModelProperty("可定房间数")
    private Integer count;
    @ApiModelProperty("房间id")
    private Integer roomId;
    @ApiModelProperty("房间信息")
    private RoomInfo roomInfo;

    public Integer getPayPrice() {
        Integer minPrice = this.salePrice;
        if (Objects.nonNull(minPrice)) {
            return Double.valueOf(Math.ceil(minPrice / 200) * 100).intValue();
        }
        return null;
    }

}
